home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / PictUtils.p < prev    next >
Text File  |  1995-09-14  |  6KB  |  157 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 8:49:10 PM }
  2. {}
  3. {     File:        PictUtils.p}
  4. { }
  5. {     Contains:    Picture Utilities Interfaces.}
  6. { }
  7. {     Version:    Technology:    System 7.5}
  8. {                 Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18}
  9. { }
  10. {     Copyright:    © 1984-1995 by Apple Computer, Inc.}
  11. {                 All rights reserved.}
  12. { }
  13. {     Bugs?:        If you find a problem with this file, use the Apple Bug Reporter}
  14. {                 stack.  Include the file and version information (from above)}
  15. {                 in the problem description and send to:}
  16. {                     Internet:    apple.bugs@applelink.apple.com}
  17. {                     AppleLink:    APPLE.BUGS}
  18. { }
  19. {}
  20.  
  21. unit PictUtils;
  22. interface
  23.  
  24.  
  25. {$IFC UNDEFINED __PICTUTILS__}
  26. {$SETC __PICTUTILS__ := 1}
  27.  
  28.     uses
  29.         ConditionalMacros, Types, Quickdraw, Controls, Windows, Palettes;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.  
  35.     const
  36.         returnColorTable = $0001;
  37.         returnPalette = $0002;
  38.         recordComments = $0004;
  39.         recordFontInfo = $0008;
  40.         suppressBlackAndWhite = $0010;
  41.  
  42. { color pick methods }
  43.         systemMethod = 0;                            { system color pick method }
  44.         popularMethod = 1;                            { method that chooses the most popular set of colors }
  45.         medianMethod = 2;                            { method that chooses a good average mix of colors }
  46. { color bank types }
  47.         ColorBankIsCustom = -1;
  48.         ColorBankIsExactAnd555 = 0;
  49.         ColorBankIs555 = 1;
  50.  
  51.  
  52.     type
  53.         PictInfoID = LONGINT;
  54.  
  55.         CommentSpec = record
  56.                 count: INTEGER;                                { number of occurrances of this comment ID }
  57.                 ID: INTEGER;                                { ID for the comment in the picture }
  58.             end;
  59.  
  60.         CommentSpecPtr = ^CommentSpec;
  61.         CommentSpecHandle = ^CommentSpecPtr;
  62.  
  63.         FontSpec = record
  64.                 pictFontID: INTEGER;                                { ID of the font in the picture }
  65.                 sysFontID: INTEGER;                                { ID of the same font in the current system file }
  66.                 size: array[0..3] of LONGINT;                { bit array of all the sizes found (1..127) (bit 0 means > 127) }
  67.                 style: INTEGER;                                { combined style of all occurrances of the font }
  68.                 nameOffset: LONGINT;                                { offset into the fontNamesHdl handle for the font’s name }
  69.             end;
  70.  
  71.         FontSpecPtr = ^FontSpec;
  72.         FontSpecHandle = ^FontSpecPtr;
  73.  
  74.         PictInfo = record
  75.                 version: INTEGER;                                { this is always zero, for now }
  76.                 uniqueColors: LONGINT;                                { the number of actual colors in the picture(s)/pixmap(s) }
  77.                 thePalette: PaletteHandle;                            { handle to the palette information }
  78.                 theColorTable: CTabHandle;                                { handle to the color table }
  79.                 hRes: Fixed;                                    { maximum horizontal resolution for all the pixmaps }
  80.                 vRes: Fixed;                                    { maximum vertical resolution for all the pixmaps }
  81.                 depth: INTEGER;                                { maximum depth for all the pixmaps (in the picture) }
  82.                 sourceRect: Rect;                                    { the picture frame rectangle (this contains the entire picture) }
  83.                 textCount: LONGINT;                                { total number of text strings in the picture }
  84.                 lineCount: LONGINT;                                { total number of lines in the picture }
  85.                 rectCount: LONGINT;                                { total number of rectangles in the picture }
  86.                 rRectCount: LONGINT;                                { total number of round rectangles in the picture }
  87.                 ovalCount: LONGINT;                                { total number of ovals in the picture }
  88.                 arcCount: LONGINT;                                { total number of arcs in the picture }
  89.                 polyCount: LONGINT;                                { total number of polygons in the picture }
  90.                 regionCount: LONGINT;                                { total number of regions in the picture }
  91.                 bitMapCount: LONGINT;                                { total number of bitmaps in the picture }
  92.                 pixMapCount: LONGINT;                                { total number of pixmaps in the picture }
  93.                 commentCount: LONGINT;                                { total number of comments in the picture }
  94.                 uniqueComments: LONGINT;                                { the number of unique comments in the picture }
  95.                 commentHandle: CommentSpecHandle;                        { handle to all the comment information }
  96.                 uniqueFonts: LONGINT;                                { the number of unique fonts in the picture }
  97.                 fontHandle: FontSpecHandle;                            { handle to the FontSpec information }
  98.                 fontNamesHandle: Handle;                                    { handle to the font names }
  99.                 reserved1: LONGINT;
  100.                 reserved2: LONGINT;
  101.             end;
  102.  
  103.         PictInfoPtr = ^PictInfo;
  104.         PictInfoHandle = ^PictInfoPtr;
  105.  
  106.  
  107.     function GetPictInfo (thePictHandle: PicHandle; var thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  108.     {$IFC NOT GENERATINGCFM}
  109.     inline
  110.         $303C, $0800, $A831;
  111.     {$ENDC}
  112.     function GetPixMapInfo (thePixMapHandle: PixMapHandle; var thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  113.     {$IFC NOT GENERATINGCFM}
  114.     inline
  115.         $303C, $0801, $A831;
  116.     {$ENDC}
  117.     function NewPictInfo (var thePictInfoID: PictInfoID; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  118.     {$IFC NOT GENERATINGCFM}
  119.     inline
  120.         $303C, $0602, $A831;
  121.     {$ENDC}
  122.     function RecordPictInfo (thePictInfoID: PictInfoID; thePictHandle: PicHandle): OSErr;
  123.     {$IFC NOT GENERATINGCFM}
  124.     inline
  125.         $303C, $0403, $A831;
  126.     {$ENDC}
  127.     function RecordPixMapInfo (thePictInfoID: PictInfoID; thePixMapHandle: PixMapHandle): OSErr;
  128.     {$IFC NOT GENERATINGCFM}
  129.     inline
  130.         $303C, $0404, $A831;
  131.     {$ENDC}
  132.     function RetrievePictInfo (thePictInfoID: PictInfoID; var thePictInfo: PictInfo; colorsRequested: INTEGER): OSErr;
  133.     {$IFC NOT GENERATINGCFM}
  134.     inline
  135.         $303C, $0505, $A831;
  136.     {$ENDC}
  137.     function DisposePictInfo (thePictInfoID: PictInfoID): OSErr;
  138.     {$IFC NOT GENERATINGCFM}
  139.     inline
  140.         $303C, $0206, $A831;
  141.     {$ENDC}
  142. {$IFC OLDROUTINENAMES }
  143.     function DisposPictInfo (thePictInfoID: PictInfoID): OSErr;
  144.     {$IFC NOT GENERATINGCFM}
  145.     inline
  146.         $303C, $0206, $A831;
  147.     {$ENDC}
  148. {$ENDC}
  149.  
  150. { $ALIGN RESET}
  151. { $POP}
  152.  
  153. {$ENDC}
  154.  {__PICTUTILS__}
  155.  
  156. implementation
  157. end.